 // const [show, setShow] = useSessionStorage('show', 'false')
// setShow(!show)
import { useEffect, useState } from "react"
const useSessionStorage = (key: string, fallback?: any) => {
   const [val, setVal] = useState(
    JSON.parse(window.sessionStorage.getItem(key)  || fallback)
   )
   
   useEffect(() => {
    window.sessionStorage.setItem(key, JSON.stringify(val))
   }, [key, val])

  return [val, setVal]
}

export default useSessionStorage